From 1e9a36ffa8d198212cde130a021256fd142ba6c5 Mon Sep 17 00:00:00 2001 From: Corey Berla Date: Mon, 25 Jul 2022 15:35:20 -0700 Subject: [PATCH] gridview: Allow starting rubberband in empty space below last row Rubberband does not work when initiated past the last row (warning is printed "Could not start rubberbanding: No item). Clamp y at the max height of the widgets in the gridview Fixes: #3462 --- gtk/gtkgridview.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkgridview.c b/gtk/gtkgridview.c index c2a4abe9d2..869f4be206 100644 --- a/gtk/gtkgridview.c +++ b/gtk/gtkgridview.c @@ -441,6 +441,7 @@ gtk_grid_view_get_position_from_allocation (GtkListBase *base, return FALSE; n_items = gtk_list_base_get_n_items (base); + along = CLAMP (along, 0, gtk_grid_view_compute_total_height (self) - 1); if (!gtk_grid_view_get_cell_at_y (self, along, &pos, -- 2.30.2